#include <climits>
#include <ios>
#include <iostream>
#include <vector>
using namespace std;
#define int long long
 
signed main()
{
    int n = 0, k = 0; // k是滑动窗口的大小
    cin >> n >> k;
    vector<int> a(n), b(n);
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
    }
    for (int i = 0; i < n; ++i)
    {
        cin >> b[i];
    }
    int aSum = 0, bSum = 0, res = 0;
    int aMax = INT_MIN, bMin = INT_MAX;
    for (int left = 0, right = 0; right < n; ++right)
    {
        aSum += a[right]; // 进窗口
        bSum += b[right]; // 进窗口
        while(right - left + 1 > k) // 判断
        {
            aSum -= a[left];
            bSum -= b[left];
            ++left; // 出窗口
        }
        if(aSum > aMax || (aSum == aMax && bSum < bMin)) // 更新结果
        {
            res = left;
            aMax = aSum;
            bMin = bSum;
        }
    }
    cout << res + 1 << endl;
    return 0;
}